<?php
/*
 * Auther:Guan Junming <junming.guan at kisters.cn>
 * Created:Sep 14, 2010 12:09:28 PM
 * Company:Kisters AG
 */

$totalLength = 30;
$lengPassed = 0;
$needLength = $totalLength / 2;

$planNum = 1;
while($lengPassed <= $needLength){
    $lengPassed += $needLength / (2 * $planNum++);
}
echo $planNum;
?>
